package com.hzxgs.tracelogstarter.config;

import org.slf4j.TtlMDCAdapter;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @Description 初始化，并且替换MDC中的adapter对象
 * @Author wangzehui
 * @Date 2024/8/12 15:46
 */
public class TtlMDCAdapterInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {

    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        // 加载TtlMDCAdapter实例
        TtlMDCAdapter.getInstance();
    }
}
